package com.ehsy.statement;

import com.ehsy.common.ResponseVo;
import com.ehsy.service.RequestMethodService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author YanZhen_Li
 * @version 1.0
 * @title 请求方法
 * @description
 * @create 2024/6/17 13:48
 */
@SpringBootTest
public class A1请求方法 {
    @Resource
    RequestMethodService featureService;

    /**
     * 不同请求方法测试
     */
    @Test
    public void testMethod() {
        List<ResponseVo<Object>> responseList = new ArrayList<>();
        responseList.add(featureService.getTest());
        responseList.add(featureService.postTest());
        responseList.add(featureService.putTest());
        String h = featureService.headTest();
        responseList.add(featureService.deleteTest());
        String o = featureService.optionsTest();
        responseList.add(featureService.patchTest());
        System.out.println(responseList);
        List<String> methodList = responseList
                .stream()
                .map(r -> r.getData().getMethod())
                .collect(Collectors.toList());
        System.out.println(methodList);
    }
}
